﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LuKou.Web.UserAuth;
using System.Web.Mvc;
using LuKou.Web.Core;

namespace LuKou.Web.Controllers.Base
{
    public class ManageBaseController :BaseController
    {
        private IMembership membership = null;

        public ManageBaseController()
        {

        }

        public override IMembership Membership
        {
            get
            {
                if (membership == null)
                {
                    membership = new AdminMembership();
                    membership.Read();
                }
                return membership;
            }
        }

        protected override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            ViewData["AdminName"] = this.Membership.User.UserName;
            ViewData["LoginIP"] = Public.UserIP;

            base.OnResultExecuting(filterContext);
        }
    }
}
